package com.thinkmore.es.entity;

import com.xpc.easyes.core.anno.TableField;
import com.xpc.easyes.core.anno.TableName;
import com.xpc.easyes.core.enums.Analyzer;
import com.xpc.easyes.core.enums.FieldType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
//@TableName(shardsNum = 3,replicasNum = 2) // 可指定分片数,副本数,若缺省则默认均为1
@TableName(value = "res2")
@AllArgsConstructor
@NoArgsConstructor
public class EsResFile {
    @TableField(fieldType = FieldType.KEYWORD)
    private String id;
    @TableField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_MAX_WORD, searchAnalyzer = Analyzer.IK_MAX_WORD)
    private String title;
    @TableField(fieldType = FieldType.KEYWORD)
    private String titlePinYin;
    @TableField(fieldType = FieldType.KEYWORD)
    private String dirId;
    @TableField(fieldType = FieldType.KEYWORD)
    private String siteId;
    //思考：只读，针对企业云盘有效
    @TableField(fieldType = FieldType.KEYWORD)
    private String[] readRoleId;
    @TableField(fieldType = FieldType.KEYWORD)
    //思考：可编辑，针对企业云盘有效
    private String[] editorRoleId;
    //思考：userId针对个人云盘有效
    @TableField(fieldType = FieldType.KEYWORD)
    private String userId;
    //创建人用户名，冗余字段，用于界面显示不回表mysql
    @TableField(fieldType = FieldType.KEYWORD)
    private String loginId;
    @TableField(fieldType = FieldType.KEYWORD)
    private String fileId;
    @TableField(fieldType = FieldType.KEYWORD)
    private String fileType;
    private long fileSize;
    @TableField(fieldType = FieldType.DATE, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private String createTime;
    @TableField(fieldType = FieldType.DATE, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private String updateTime;
}
